package com.dgut.courses_selecting_sys.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dgut.courses_selecting_sys.entity.User;
import com.dgut.courses_selecting_sys.entity.UserRole;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author yuec
 * @since 2020-08-06
 */
@Repository
public interface UserRoleMapper extends BaseMapper<UserRole> {
    public List<User> teachList(int deptId);

    public List<User> stuList(int deptId);

    @Insert("insert into sys_user_role (user_id,role_id) values (#{userId},#{roleId})")
    public int insertOne(@Param("userId") long userId, @Param("roleId") int roleId);
}
